<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div id="app2">
    <button @click="add">按钮</button>
    <el-table
            :data="type"
            style="width: 100%">
        <el-table-column
                prop="OPERATETIME"
                label="日期"
                width="180">
        </el-table-column>
        <el-table-column
                prop="DELIVERMAN"
                label="姓名"
                width="180">
        </el-table-column>
        <el-table-column
                prop="OPERATEDEP"
                label="地址">
        </el-table-column>
    </el-table>
</div>

<script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
    var vm2=new Vue({
        el:"#app2",
        data:{
            items:[
                {message:"Test one",id:"1"},
                {message:"Test two",id:"2"},
                {message:"Test three",id:"3"}
            ],
            type:'',
            tableData: [{
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
            }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
            }, {
                date: '2016-05-03',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1516 弄'
            }]
        },
        methods:{
            btn2Click:function(){
                //Vue methods中的this 指向的是Vue的实例，这里可以直接在this中找到items
                Vue.set(this.items,this.items.length,{message:"Change Test",id:'10'})
            },
            btn3Click:function(){
                var itemLen=this.items.length;
                Vue.set(this.items,itemLen,{message:"Test add attr",id:itemLen});
            },add(){
                axios.get("http://bird.ioliu.cn/v2/?url=http://175.102.133.190:8383/A1_INTE/BillState/queryBillHistory.do?&bill_no=WX153021787").then((re)=>{

                    if(re.statusText=="OK"){
                        let a= re.data;
                        let b = a.substring(5,a.length-2);
                        let c = JSON.parse(b);
                        if(c.returnType=="SUCCESS"){
                            this.type = c.returnValue;
                            console.log(this.type);
                        }
                    }
                })
            }
        },mounted(){

        },created(){}
    });

</script>
</body>
</html>